package com.wulaoda.bilimanage.controller;

import com.wulaoda.bilimanage.entity.ChargeEntity;
import com.wulaoda.bilimanage.req.ChargeReq;
import com.wulaoda.bilimanage.resp.CommonResp;
import com.wulaoda.bilimanage.resp.PageResp;
import com.wulaoda.bilimanage.service.ChargeService;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.List;

@RestController
@RequestMapping("/charge")
public class ChargeController {

    @Resource
    private ChargeService chargeService;

    @GetMapping("/getList")
    public CommonResp getList(ChargeReq req){
        CommonResp<PageResp<ChargeEntity>> resp = new CommonResp<>();
        PageResp<ChargeEntity> list = chargeService.getList(req);
        resp.setContent(list);
        return resp;
    }

}
